<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/taglib.jsp"%>
<link href="<%=request.getContextPath() %>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
<script>
	$(function(){
			 //日期选择控件
		 	$("#startDate").click(function(){
				WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'endDate\')}',isShowClear:true, readOnly:true });
			});
			$("#endDate").click(function(){
				WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'startDate\')}',isShowClear:true, readOnly:true });
			});
		});
   	function delVoucher(id){
   		if(!confirm('确定删除报单吗')) return;
   		location.href = "delVoucher?voucherid="+id;
   	}
   	
</script>
<div class="action  divaction">
	<div class="t">报销单列表</div>
	<div class="pages">
		<div class="forms">
			
	     </div>
	<!--增加报销单 区域 开始-->
	<form action="claimVoucher_searchClaimVoucher.action" name="claimVoucherForm">
		<table width="90%" border="0" cellspacing="0" cellpadding="0" class="list items">
	      <tr class="even">
	        <td>编号</td>
	        <td>填报日期</td>
	        <td>填报人</td>
	        <td>总金额</td>
	        <td>状态</td>
	        <td>待处理人</td>
	        <td>操作</td>
	      </tr>
		  <c:forEach var="voucher" items="${pageInfo.list}">
	      <tr>
	        <td><a href="claimVoucher_getClaimVoucherById.action?claimVoucher.id=">${voucher.id}</a></td>
	        <td><fmt:formatDate value="${voucher.create_time}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
	        <td>${voucher.CEmployee.name}</td>
	        <td>${voucher.total_account}</td>
	        <td>${voucher.status}</td>
	        <td>${voucher.NEmployee.name}</td>
	        <td>
	        	<c:if test="${voucher.status=='新创建' || voucher.status=='已打回'}">
	        		<a href="claimVoucher_toUpdate_action?id=${voucher.id}">
			        	<img src="${images}/edit.gif" width="16" height="16" /> 
			        </a>
			        <a onClick="delVoucher(${voucher.id})" href="#">
			        	<img src="${images}/delete.gif" width="16" height="16" />
			        </a>
		        </c:if>
		        <img src="${images}/save.gif" width="16" height="16" /> 
		        <a href="findVoucherById?voucherid=${voucher.id}">
		        	<img src="${images}/search.gif" width="16" height="15" />
		        </a>
		        <c:if test="${voucher.next_deal_sn == sessionScope.emp.sn}">
		        	<c:if test="${voucher.status=='已提交' || voucher.status=='待审批'|| voucher.status=='已审批'}">
				        <a href="toCheckVoucher?voucherid=${voucher.id}">
				         <img src="${images}/sub.gif" width="16" height="16" />
				        </a>
			        </c:if>
		        </c:if>
	        </td>
	      </tr>
		  </c:forEach>
	      <tr>
	        <td colspan="6" align="center">
				<div class="page-bar">
					<c:if test="${pageInfo.pageNum>1}">
						<a href="findVoucher?pageNo=1">首页</a>
						<a href="findVoucher?pageNo=${pageInfo.pageNum-1}">上一页</a>
					</c:if>
					<c:if test="${pageInfo.pageNum<=1}">
						首页&nbsp;&nbsp;上一页
					</c:if>
					<c:if test="${pageInfo.pageNum<pageInfo.pages}">
						<a href="findVoucher?pageNo=${pageInfo.pageNum+1}">下一页</a>
						<a href="findVoucher?pageNo=${pageInfo.pages}">最后一页</a>
					</c:if>
					<c:if test="${pageInfo.pageNum>=pageInfo.pages}">
						下一页&nbsp;&nbsp;尾页
					</c:if>&nbsp;&nbsp;
					&nbsp;&nbsp;第 ${pageInfo.pageNum}页/共${pageInfo.pages}页&nbsp;&nbsp;共${pageInfo.total}条记录
				</div>
  		  	</td>
  		  </tr>
	    </table>      
	   </form>
	          <!--增加报销单 区域 结束-->
       </div>
      </div>